var form,$,table,layer;
layui.use(['form','jquery','table','layer'],function() {
    form = layui.form;
    $ = layui.jquery;
    table = layui.table;
    layer = layui.layer;
    //展示商品分类
    showProductClassification();
});

function showProductClassification(){
    $.ajax({
        url:'/toExamine/getProductCategroys',
        dataType:'json',
        success:function (data) {
            $.each(data.data, function (index, item) {
                $('#proTitle').append(new Option(item.title, item.categroyId));// 下拉菜单里添加元素
            });
            layui.form.render("select");
        }
    });
}

//高级搜索
function search() {
    var productCode = $('input[name = productCode]').val();
    var selProTitle =  $('select[name=selProTitle]').val();
    var selStat = $('select[name=selStat]').val();
    var name = $('input[name = name]').val();
    var price = $('input[name = price]').val();
    console.log(price);
    var productLabel = $('input[name = label]').val();
    $.ajax({
        url:'/toExamine/getSeniorProduct',
        dataType:'json',
        data:{
            "productCode":productCode,
            "categroyId":selProTitle,
            "productSate":selStat,
            "productName":name,
            "currentpriceProduct":price,
            "productLabel":productLabel
        },
        success:function (data) {
            parent.showMicrocircleList(data.data);
            var layer = parent.layer;
            layer.close(layer.index);
        }
    });
}